﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using UpYourLife.Helpers;
using Microsoft.Maps.MapControl;
using System.Windows.Media.Imaging;

namespace UpYourLife.UserControls
{
    public partial class UcPushpinPlaces : UserControl
    {
        CustomPushpin _customePushpin;
        public UcPushpinPlaces()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(UcPushpinPlaces_Loaded);                
        }

        void UcPushpinPlaces_Loaded(object sender, RoutedEventArgs e)
        {
            BuildPushpin();
        }
       
        public CustomPushpin CustomPushpin { get; set; }

        public Location Location { get; set; }

        public object MetaData { get; set; }

        private void BuildPushpin()
        {
            imgIcon.Source = new BitmapImage(CustomPushpin.IconUri);
            Width = CustomPushpin.Width;
            Height = CustomPushpin.Height;
            Margin = new Thickness(CustomPushpin.IconOffset.X, CustomPushpin.IconOffset.Y, 0, 0);

            //pushpinContent.Text = CustomPushpin.Content;
            //TextBlock text = new TextBlock();
            //text.Text = value.TextContent;
            //text.TextAlignment = TextAlignment.Center;
            //text.HorizontalAlignment = HorizontalAlignment.Center;
            //text.VerticalAlignment = VerticalAlignment.Center;
            //text.Foreground = value.TextColor;
            //text.FontSize = value.FontSize;
            //text.Margin = new Thickness(value.TextOffet.X, value.TextOffet.Y, 0, 0);
        }  
    }
}
